<!DOCTYPE html>
<html lang="en">
<head>
    <title>乐哈小游戏管理后台</title>
    <meta name="description" content="用户登录"/>
    #parse("include/head.html")
</head>

<body class="login-layout light-login">
<div class="main-container">
    <div class="main-content">
        <div class="row">
            <div class="col-sm-10 col-sm-offset-1">
                <div class="login-container">
                    <div class="space-32"></div>
                    <div class="center">
                        <h1>
                            <i class="ace-icon fa fa-coffee red"></i>
                            <!--<span class="red">Ace</span>-->
                            <span class="grey" id="id-text2">乐哈信息技术</span>
                        </h1>
                        <h4 class="blue" id="id-company-text">乐哈小游戏管理后台</h4>
                    </div>

                    <div class="space-24"></div>

                    <div class="position-relative">
                        <div id="login-box" class="login-box visible widget-box no-border">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <h4 class="header  lighter light-grey" >
                                        <i class="ace-icon fa fa-info-circle light-grey"></i>
                                        请输入您的用户名和密码
                                    </h4>

                                    <div class="space-6"></div>

                                    <form id="userLoginForm" action="validate">
                                        <fieldset>
                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" name="username" id="username" class="form-control"
                                                                   placeholder="用户名"/>
															<i class="ace-icon fa fa-user"></i>
														</span>
                                            </label>

                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" class="form-control"
                                                                   id="password" name="password"
                                                                   placeholder="密码"/>
															<i class="ace-icon fa fa-lock"></i>
														</span>
                                            </label>

                                            <div class="space"></div>

                                            <div class="clearfix col-xs-12 text-center">
                                                <!--<label class="inline">-->
                                                <!--<input type="checkbox" class="ace"/>-->
                                                <!--<span class="lbl"> Remember Me</span>-->
                                                <!--</label>-->

                                                <button type="submit"
                                                        class="width-35  btn btn-sm btn-primary btn-red ">
                                                    <i class="ace-icon fa fa-key"></i>
                                                    <span class="bigger-110">登录</span>
                                                </button>
                                            </div>

                                            <div class="space-4"></div>
                                        </fieldset>
                                    </form>

                                    <!--<div class="social-or-login center">-->
                                    <!--<span class="bigger-110">Or Login Using</span>-->
                                    <!--</div>-->
                                    <div class="space-6"></div>

                                </div>
                                <!-- /.widget-main -->

                            </div>
                            <!-- /.widget-body -->
                        </div>
                        <!-- /.login-box -->
                    </div>
                    <!-- /.position-relative -->

                </div>
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </div>
    <!-- /.main-content -->
</div>
<!-- /.main-container -->
#parse("include/libs.html")
<!-- inline scripts related to this page -->
#[[
<!-- inline scripts related to this page -->
<script type="text/javascript">

    var submitLock = false;
    var validator;
    var invitationValidator;
    var options = {
        beforeSubmit: function () {
            if (submitLock) {
                return false;
            }
            loading('正在验证，请稍等...');
            submitLock = true;
            return true;
        },
        success: function (data) {
            submitLock = false;
            if (data.data != null) {
                succ('登录成功，正在加载...');
                delay(function () {
                    console.log(data);
                    document.location.href = './';
                }, 2000);
            } else {
                error(data.resultMsg);
            }
        },
        error: function () {
            submitLock = false;
            error('系统繁忙，请稍候重试！');
        },
        dataType: 'json',
        type: 'post',
        timeout: 30000
    };

    $(function () {
        $('#username,#password').keypress(function (event) {
            if (event.which == 13)
                $('#userLoginForm').submit();
        });
        $('#loginBtn').click(function () {
            $('#userLoginForm').submit();
        });
        validator = $("#userLoginForm").validate({
            errorElement: "em",
            rules: {
                "username": {
                    required: true
                },
                "password": {
                    required: true
                }
            },
            messages: {
                "username": {
                    required: '请输入您的登录用户名！'
                },
                "password": {
                    required: '请输入您的登录密码！'
                }
            },
            submitHandler: function (form) {
                $(form).ajaxSubmit(options);
            }
        });
    });
</script>
]]#
</body>
</html>
